import { NIcon } from "naive-ui"
import * as $Icon from "@vicons/antd"

export const renderIcon = (icon: Component, props: any | null = null) => {
    return () => {
        return h(NIcon, props, {
            default: () => h(icon)
        })
    }
}

export const renderAntIcon = (icon: string) => {
    const antIcon: { [key: string]: any } = $Icon
    return () => {
        return h(NIcon, null, {
            default: () => h(antIcon[icon])
        })
    }
}
